// mycomponent/postItem/postItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    images:{
      type:null,
    }
  },
  lifetimes: {
    attached: function() {
      if (this.data.images ) {
        if (this.data.images.length > 9) {
          this.data.list = this.data.images.slice(0, 9);
          this.data.showViewMore = true;
        } else if(this.data.images.length==1) {
          this.data.list = this.data.images;
        }else{
          this.data.list = this.data.images;
        }
      }
      this.setData({list:this.data.list,showViewMore:this.data.showViewMore})
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    list:[],
    showViewMore:false
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
